<h2 class="subtitle">Tags</h2>

<table class="table tags-table is-fullwidth">
  <tbody>
    <%= unless Enum.empty?(@page.slice) do %>
      <%= for {tag, author, timestamp} <- @page.slice do %>
        <tr>
          <td>
            <a href="<%= Routes.codebase_path(@conn, :tree, @repo.owner_login, @repo, tag, []) %>" class="button is-small has-text-weight-medium"><%= tag %></a>
          </td>
          <td>
            tagged <%= datetime_format(timestamp, "{relative}") %> by
            <%= if Map.has_key?(author, :id) do %>
              <a href="<%= Routes.user_path(@conn, :show, author) %>" class="tag user"><%= author %></a>
            <% else %>
              <a href="mailto:<%= author.email %>" class="tag tooltip has-text-black" data-tooltip="<%= author.email %>"><%= author.name %></a>
            <% end %>
          </td>
        </tr>
      <% end %>
    <% else %>
      <tr>
        <td colspan="2">
          <article class="message is-light">
            <div class="message-body">This repository has no tags.</div>
          </article>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>

<%= pagination(@conn, @page) %>
